package com.hantang.web.dao;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;



@SuppressWarnings("deprecation")
public class ElbSessionFactory {

	private static ElbSessionFactory instance = new ElbSessionFactory();
	
	private SessionFactory sessionFactory;
	
	private ElbSessionFactory()
	{
        Configuration conf = new Configuration();
       // conf.addAnnotatedClass(ElbChargePO.class);
        conf.configure();
        sessionFactory = conf.buildSessionFactory();
               
	}
	// protected Session session ;
	public static ElbSessionFactory getInstance()
	{
		return instance;
	}
	
	public SessionFactory getSessionFactory()
	{
		return this.sessionFactory;
	}
	public void close()
	{
		if(this.sessionFactory != null)
		{
			this.sessionFactory.close();
		}
	}
	
}
